<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:rich="http://richfaces.org/rich">	
<ui:composition template="/pages/layout/masterLayout.xhtml">
	<ui:define name="tituloPagina">Pesquisar Arquivos</ui:define>
	<ui:define name="conteudo">
		<div style="width: 100%; clear:both;">
			<br/>
			<h1>:: Resultado da Pesquisa ::</h1>
			<t:saveState value="#{arquivoBean.arquivosPesquisados}" />
			<h:form>
				<t:dataTable rows="10"  id="tabelaArquivos" binding="#{arquivoBean.tabelaResultados}" var="arq" value="#{arquivoBean.arquivosPesquisados}" style="width: 100%" rowClasses="impar,par">
					<f:facet name="header">
						<h:outputText value="Arquivos" />
					</f:facet>
					<h:column id="idArquivo">
						<f:facet name="header">
							<h:outputText value="Id" />
						</f:facet>
						<h:outputText value="#{arq.id}"/>
					</h:column>
					<h:column id="nomeArquivo">
						<f:facet name="header">
							<h:outputText value="Nome" />
						</f:facet>
						<h:commandLink action="#{arquivoBean.selecionaArqTabela}" value="#{arq.nome}" />
					</h:column>
					<h:column id="descricao">
						<f:facet name="header">
							<h:outputText value="Descrição" />
						</f:facet>
						<h:outputText value="#{arq.descricao}"/>
					</h:column>
					<h:column id="usuario">
						<f:facet name="header">
							<h:outputText value="Usuário" />
						</f:facet>
						<h:outputText value="#{arq.usuario.nome}"/>
					</h:column>				
					<h:column id="data">
						<f:facet name="header">
							<h:outputText value="Data de upload" />
						</f:facet>
						<h:outputText value="#{arq.dataUpload}"/>
					</h:column>				
					<f:facet name="footer">
						<h:panelGroup rendered="#{empty arquivoBean.arquivosPesquisados}">
							<h:outputText value="#{msg['tabela.vazia']}" />
						</h:panelGroup>
					</f:facet>
				</t:dataTable>
				<h:panelGroup rendered="#{not empty arquivoBean.arquivosPesquisados}">
					<div id="menuNavegacao">
						<rich:dataScroller for="tabelaArquivos" maxPages="5" >
						</rich:dataScroller>
					</div>
				</h:panelGroup>				
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>